//
// Created by haoy on 2017/4/29.
//

#ifndef RTC_XSWITCH_CONTEXT_HPP
#define RTC_XSWITCH_CONTEXT_HPP

#include <atomic>
#include <iostream>
#include <list>
#include <string>
#include <sstream>
#include <mutex>
#include <vector>

#include "Audio.hpp"
#include "stat.hpp"
#include "metric.hpp"

class Context {
public:
    Context();

    std::string toString() const;

    int workers = 1;
    std::vector<std::string> rtcAddresses;
    char* logConfigFile;
    std::string mediaAddress;
    int concurrency;
    int rampUpSeconds;
    int durationSeconds;
    int verbosity;
    int minMediaPort;
    int maxMediaPort;
    int video_bitrate;

    enum class Sequence {
        Offerer,
        Answerer
    } sequence;

    bool replace_candidate;
    std::string replace_candidate_from;
    std::string replace_candidate_to;

    std::list<char*> audio_files;
    std::list<Audio*> audios;
    char* mixer_id;
    bool subscribe_self;
    bool child;
    char* metric_server_address;

    int n_pub = 0;
    std::vector<const char*> pub_rtc_ids;
};


#endif //RTC_XSWITCH2_CONTEXT_HPP
